
from PyQt5.QtCore import pyqtSignal, QObject

class Player(QObject):
    time_chage = pyqtSignal(int)

    default_time = 100

    def __init__(self, name='player', status = False):
        super().__init__()
        self.name = name
        self.run_time = Player.default_time
        self.status = status
    
    def down_time(self):
        self.run_time -= 1 
        self.time_chage.emit(self.run_time)

    def set_time(self, value):
        self.run_time = value
        self.time_chage.emit(self.run_time)

    def reset_time(self,value):
        self.run_time = value
        #self.time_chage.emit(self.run_time)